<template>
    <div>
        <table class="table table-bordered">
            <tbody>
                <tr>
                    <td>编号</td>
                    <td><input type="text" v-model="querInfo.code" disabled></td>
                </tr>
                <tr>
                    <td>姓名</td>
                    <td><input type="text"></td>
                </tr>
                <tr>
                    <td>性别</td>
                    <td><input type="radio" name="sex":value="1" v-model="querInfo.sex">男
                        <input type="radio" name="sex":value="0"  v-model="querInfo.sex">女
                    </td>
                </tr>
                <tr>
                    <td>年龄</td>
                    <td><input type="text" v-model="querInfo.age"></td>
                </tr>
                <tr>
                    <td>状态</td>
                    <td><input type="radio" name="sex":value="1" v-model="querInfo.state">在院治疗
                        <input type="radio" name="sex":value="2"  v-model="querInfo.state">留院观察
                        <input type="radio" name="sex":value="3"  v-model="querInfo.state">出院
                        <input type="radio" name="sex":value="4"  v-model="querInfo.state">死亡
                    </td>
                </tr>
                <tr>
                    <td>陪护人</td>
                    <td><input type="text"  v-model="querInfo.people"></td>
                </tr>
                <tr>
                    <td>科室</td>
                    <td><select  v-model="querInfo.officeName">
                        <option value="">请选择</option>
                        <option value="" >请选择</option>
                    </select>
                    </td>
                </tr>
                <tr>
                    <td>病区</td>
                    <td><input type="text" v-model="querInfo.area"></td>
                </tr>
                <tr>
                    <td>等级</td>
                    <td><input type="radio" name="sex":value="1" v-model="querInfo.level">一级护理
                        <input type="radio" name="sex":value="2"  v-model="querInfo.level">二级护理
                        <input type="radio" name="sex":value="3" v-model="querInfo.level">三级护理
                        
                    </td>
                </tr>
                <tr>
                    <td>图片</td>
                    <td><input type="file" ></td>
                </tr>
                <tr>
                    <td>爱好</td>
                    <td>
                        <input type="checkbox" value="象棋" v-model="querInfo.level">象棋
                        <input type="checkbox" value="围棋" v-model="querInfo.level">围棋
                        <input type="checkbox" value="军旗" v-model="querInfo.level">军旗
                        <input type="checkbox" value="飞行棋" v-model="querInfo.level">飞行棋
                    </td>
                </tr>
                <tr>
                    <td>简介</td>
                    <td>
                        <textarea cols="50" rows="5"></textarea>
                    </td>
                </tr>
                <tr>
                    <td></td>
                    <td>
                        <input type="button" value="添加" @click="" class="btn btn-primary">
                    </td>
                </tr>
            </tbody>
        </table>
    </div>
</template>

<script setup lang="ts">
import { ref,reactive,onMounted } from 'vue';
import axios from 'axios';
import moment from 'moment';
import { useRoute,useRouter } from 'vue-router';
const route=useRoute();
const router=useRouter();


let querInfo:any=reactive({

  "code": moment(new Date()).format('YYYYMMDD')+Math.random().toString().substring(2,5),
  "name": "",
  "sex": "",
  "age": "",
  "state": 1,
  "people": "",
  "officeName": "",
  "area": "",
  "level": 1,
  "photo": "",
  "likes": "",
  "desc": "",
  "isDel": true



});

const img=(e:any)=>{
    let obj=e.target.files[0];
    let f =new FormData();
    f.append('file',obj);
    axios({
        url:'/api/File/Imgs',
        method:'post',
        data:f,
    })
    .then((res)=>{
        if(res.data>0)
    {
        alert("上传成功")
        return;
    }
    else
    {
        alert("上传失败")
        return;
    }
    })
}

</script>

<style scoped>

</style>